/**
 * 
 */
package com.googlecode.pcapj;

import java.io.InputStream;

/**
 * Represents a TCP packet.
 */
public interface TCPPacket extends Packet{
	/**
	 * Gets the source port.
	 * @return the source port.
	 */
	int getSource();
	/**
	 * Gets the destination port.
	 * @return the destination port.
	 */
	int getDestination();
	/**
	 * Gets the Sequence Number.
	 * @return the Sequence Number.
	 */
	long getSequenceNumber();
	/**
	 * Gets the Acknowledgment Number.
	 * @return the Acknowledgment Number.
	 */
	long getACK();
	/**
	 * Gets the Data Offset.
	 * @return the Data Offset.
	 */
	int getDataOffset();
	/**
	 * Tests whether a Urgent Pointer.
	 * @return true if Urgent Pointer.
	 */
	boolean isURG();
	/**
	 * Tests whether a Acknowledgment.
	 * @return true if Acknowledgment.
	 */
	boolean isACK();
	/**
	 * Tests whether Push Function.
	 * @return true if Push Function.
	 */
	boolean isPSH();
	/**
	 * Tests whether reset the connection.
	 * @return true if reset the connection.
	 */
	boolean isRST();  
	/**
	 * Tests whether synchronize sequence numbers.
	 * @return true if synchronize sequence numbers.
	 */
	boolean isSYN();  
	/**
	 * Tests whether no more data from sender.
	 * @return true if no more data from sender.
	 */
	boolean isFIN();
	/**
	 * Gets the window size.
	 * @return the window size.
	 */
	int getWindow();
	/**
	 * Gets the Checksum.
	 * @return the Checksum.
	 */
	short getChecksum();
	/**
	 * Gets the UrgentPointer.
	 * @return the UrgentPointer.
	 */
	short getUrgentPointer();
	/**
	 * Gets the Options filed.
	 * @return the Options filed.
	 */
	byte[] getOptions();
	/**
	 * Gets the data.
	 * @return the data.
	 */
	byte[] getData();
	/**
	 * Gets the InputStream to read the data of the TCP packet.
	 * @return
	 */
	InputStream getDataInputStream();
}
